#ifndef CIOPS_OP_SCALE_H
#define CIOPS_OP_SCALE_H

#include "Operation.h"
#include "../Core/Matrix.h"

namespace CIOps {
    /**
     * This class represents the operation to scale primitives
     **/
    class OP_Scale : public Operation {    

    public:            
        OP_Scale (std::vector<CIView::View*>& v);       //Constructor
        virtual ~OP_Scale();                    //Destructor

    protected:
        CICore::Point click;                                //The mouse click coordinates (In world coordinates)
        CICore::Vector3D drag;                              //The mouse drag values (In world coordinates)
        CICore::Vector3D scale;                             //The scaling values

        CICore::Point& feedbackPos;                         //A reference to the feedback position

        CICore::Matrix scalingMatrix;                       //The matrix used to define the scaling transformation
        CICore::Matrix inverseMatrix;                       //The inverse matrix used to undo the scaling transformation

        unsigned int selected;                              //The selected axis of the feedback object

        bool feedbackToBeRestored;                          //A boolean to indicate if the scaling operation is around the origin

    public:            
        //Utility Methods
        virtual int Exec();         //Method called to execute directly the operation
        virtual void Undo();        //Method called to undo the operation
        virtual void Redo();        //Method called to redo the operation

        virtual void MousePressEvent (CIView::View* view, QMouseEvent* e);        //Mouse Pressed event handler
        virtual void MouseReleaseEvent (CIView::View* view, QMouseEvent* e);      //Mouse Released event handler
        virtual void MouseMoveEvent (CIView::View* view, QMouseEvent* e);         //Mouse Moved event handler
        virtual void WheelEvent (CIView::View* view, QWheelEvent* e);             //Wheel event handler
    };
}

#endif /* CIOPS_OP_SCALE_H */
